#ifndef QFITSWINDOW_H
#define QFITSINDOW_H

#include <iostream>
using namespace std;
#include <CCfits>
using namespace CCfits;
#include <QApplication>
#include <QObject>
#include <QMainWindow>
#include <QTextEdit>
#include <QSignalMapper>
#include <QMenu>
#include <QMenuBar>
#include <QPushButton>
#include <QKeyEvent>
#include <QFileDialog>
#include <QStringList>
#include <QStatusBar>
#include <QDebug>
#include <QLabel>
#include <QMessageBox>
#include <QDockWidget>
#include <QPluginLoader>
#include <QByteArray>
#include "scrolledfitsview.h"
#include "qfitsplugin.h"
#include "pluginmanager.h"
#include "colormap.h"


class QFitsWindow : public QMainWindow {
	Q_OBJECT
	QString fileName; // filename of current image
	FITS *fits;        // CCfits object of current object
	ScrolledFitsView *sview;
	QMenu *pluginMenu;

	//plugins
	void loadPlugins();
	void addToMenu(QObject *plugin, const QString name);

	Colormap colormap;
public:
	QFitsWindow(QWidget *parent = 0, Qt::WFlags fl = 0);
	~QFitsWindow();
public slots:
	void openFile(QString s = QString::null); //open file
	void exportFile(QString s = QString::null); // export png file
	void print(QString s = QString::null); //save file
	void setColormap(int i); // converts the signal to a signal containing the map itself
signals:
	void colormapChanged(QVector<QColor>); // for plugins
	void colormapChanged(const unsigned*); // for ScrolledView
private:
	QSignalMapper *signalMapper;
};

#endif // QFITSWINDOW

